package cz.spock.exception;


/**
 * Invalid data exception should be thrown when input data passed first validation, but not passed DB validation,
 * for example if uniqueness is required.
 * Used when:
 * - not unique
 * 
 * if this exception is thrown, required action can not be done, controller must react with error message
 * 
 * (expected error number in json response is 420)
 * 
 * @author miso
 *
 */
@SuppressWarnings("serial")
public class InvalidDataException extends SpockRuntimeException {
    
    public InvalidDataException(String msg) {
        super(msg);
        log.severe(msg);
    }
    
    public InvalidDataException(String msg, int errCode) {
        super(msg, errCode);
        log.severe(msg + " (code:" + errCode + ")");
    }

}
